package com.chixing.day04_oop;

/**
 * 群体性概念：是小米商城所有手机的统称
 */
public class Phone {
    //属性
    private String phoneName;//手机名称
    private  float phonePrice;//价格
    private String phoneColor;//颜色
    private  float phoneSize;//屏幕尺寸
    private int phoneCapacity;//容量

    //给外部提供了属性赋值与取值的方法

    /*
     *this:当前对象，谁在调用该方法，即指的就是这个堆中的对象
     */
    public void setPhoneName(String phoneName){
        this.phoneName=phoneName;
    }
    public String getPhoneName(){
        return this.phoneName;
    }
    public void setPhonePrice(float phonePrice){
        this.phonePrice=phonePrice;
    }
    public float getPhonePrice(){
        return this.phonePrice;
    }
    public void setPhoneColor(String phoneColor){
        this.phoneColor=phoneColor;
    }
    public String getPhoneColor(){
        return this.phoneColor;
    }
    public void setPhoneSize(float phoneSize){
        this.phoneSize=phoneSize;
    }
    public float getPhoneSize(){
        return this.phoneSize;
    }
    public void setPhoneCapacity(int phoneCapacity){
        this.phoneCapacity=phoneCapacity;
    }
    public int getPhoneCapacity(){
        return this.phoneCapacity;
    }
    //功能
    public void call(){
        System.out.println("手机打电话");
    }
    public void takePhoto(){
        System.out.println("手机拍照");
    }
    public void sendMsg(){
        System.out.println("手机发送短信");
    }
    //不是为了提供给外部使用，存在的意义是1.【减少代码冗余性】2.【给本类中其他方法使用】
    private int add (int a,int b){
        return a+b;
    }
    public int add2(int a,int b,int c){
        int sum=add(a,b);
        int result=add(sum,c);
        return result;
    }
}
